package com.atguigu.visitor.demo2;

/**
 * 老板类，查看账本的类之一，Visitor实现类
 */
public class AccountBookViewerForBoss implements AccountBookViewer {

	/** 收入 */
	private double totalIncome;
	/** 支出 */
	private double totalConsume;

	/**
	 * 老板只关注一共花了多少钱以及一共收入多少钱，其余并不关心
	 */
	public void view(BillForConsume bill) {
		totalConsume += bill.getAmount();
	}

	public void view(BillForIncome bill) {
		totalIncome += bill.getAmount();
	}

	public double getTotalIncome() {
		System.out.println("老板查看一共收入多少，数目是：" + totalIncome);
		return totalIncome;
	}

	public double getTotalConsume() {
		System.out.println("老板查看一共花费多少，数目是：" + totalConsume);
		return totalConsume;
	}

}